Skip to main content

What’s New

Qrvey 8.5
Version 8.5 (LTS) of the Qrvey platform is now available to customers. This version includes several new features and performance improvements.
Learn More
End-of-life Schedule
We've added a new article that lists the features and endpoints that have been scheduled for deprecation. All features and endpoints will be supported for (1) year after the release date of the LTS version that contains the alternative.
Learn More
NodeJS Deprecation
AWS has announced that it is deprecating NodeJS 12, 14, and 16. To avoid any issues as a result of this deprecation, upgrade your instances of the Qrvey platform as described in this announcement.
Learn More
Version: 8.5

Analytic Suite Widget

When embedded in an application, the Analytic Suite widget enables users to display the distinct views available on the analyze side (i.e Summary, Table, Custom, and Metric views).

Before You Begin

Get the Helper Code

  1. In Qrvey Composer, display the Analyze tab for the desired dataset.
  2. Click the Embedding Options button in the upper right corner of the page. A dialog displays with an HTML tag, a JSON configuration object, and the Widget Launcher script tag.
  3. Click Copy to copy the code, and then paste it into your preferred editor.

Embed the HTML tag

Identify where you would like this widget to display in your application, and then add the HTML tag in that location.

The HTML tag for this widget is:

<an-dashboard config="anSuiteConfig"></an-dashboard>

Embed the Widget Launcher Script Tag

Add the widget launcher script tag to your application. Note that this widget requires an additional script for proper support in all browsers.

For reference, the launcher script code is:

<script type="module" src="https://<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.esm.js"></script>
<script nomodule src="https://<WIDGETS_URL>/qrvey-an-widgets/an-dashboard/andashboard/andashboard.js"></script>

Set Properties in the JSON Configuration Object

Define the JSON configuration object by starting with the script provided in the helper code, and then adding additional configuration properties as needed. The script provided contains only the required properties. For reference, an example is copied below. The helper code that you obtained above should include the unique values indicated with brackets (“<>”):

<script>
var anSuiteConfig = {
"api_key": "<API_KEY>",
"app_id": "<APP_ID>",
"domain": "https://<your_qrvey_domain>",
"user_id": "<USER_ID>",
"qrveyid": "<QRVEY_ID>",
"settings": {
"view": "CUSTOM_VIEW"
}
}
</script>

When complete, add the JSON configuration object to your application.

Configuration Object Properties

The following table lists the properties associated with this widget.

PropertyValueRequired
api_keyString, Your organization’s unique API key required to access the Qrvey platform. Never expose your organization’s API key to external users. In Production environments, use a secure token (qv_token) to encrypt the API key.Yes, if the qv_token is not provided
qv_tokenString, A secure token encrypted via JWT to authenticate and authorize embedded widgets. Establishes a secure connection between the host application and the Qrvey system. For more information, see Embedding Widgets Using a Security Token.Yes, if the api_key is not provided
app_idString, ID of the Qrvey application containing the dashboard, report, automation, or web form.Yes
domainString, The base URL of your instance of the Qrvey platform.Yes
user_idString, ID of the Qrvey Composer user that owns the application that is being embedded. Optional: You can alternately specify the user ID in a Qrvey session cookie.Yes, if the user_id is not included in a session cookie
clientidString, Unique identifier for the tenant end user. Required for using the End User Personalization feature. The clientid must be set to a unique value for each tenant end user.No
timezoneObject <TimezoneConfiguration>, Overrides the time zone setting in Qrvey Admin Center. For more information, see Configuring Time Zone Settings.No
qrveyidString, ID of the dataset being used.Yes
settingsObject, general configuration in order to set some behaviors.No
settings.viewString, determines the initial view to display and it accepts:
SUMMARY_VIEW/MULTI_PANEL
TABULAR_VIEW
CUSTOM_VIEW
METRIC_VIEW
Default: MULTI_PANEL (alias for SUMMARY_VIEW)
No
settings.modeString, determines displaying the complete layout or the views only. It depends on set view and it accepts:
COMPLETE
SIMPLE
* Default: COMPLETE
No
settings.displayModeString, changes the style and extends the layout onto the entire container.
FULL
NORMAL
* Default: NORMAL
No
userFiltersObject, the filters object generated by the user. This will be applied in internal components to filter the data. I.e. AN Single Panel.
{filters: <Filters Key Structure>}
To see more info about filter structure, visit https://documenter.getpostman.com/view/1152381/TVejh9vP#5e81efdb-5e32-4fca-892f-090dc0388e33
No
themeidString, theme ID to use in the componentNo
settings.stylesObject, styles options object. These properties will extend from the current themeNo
settings.styles.chartsTitleString, set the charts title colorNo
settings.styles.chartsFontFamilyString, set the charts font familyNo
settings.styles.axisDataLabelsString, set axis labels color in chartsNo
settings.styles.dataLabelsString, color for data labels in chartsNo
settings.styles.valuesMainString, set color for axis ticks values in chartsNo
settings.styles.chartsLegendsString, color for charts legends labelsNo
settings.styles.chartsTooltipsString, color for charts tooltipsNo
settings.styles.tableHeaderFontString, set color for table header textsNo
settings.styles.chartsMainString, set color for chart data points like bars, symbols and lines.No
settings.styles.themePaletteArray, contains a maximum of 20 colors that will be used for chart data points.No
custom_tokensObject, contains a set of custom tokens, each of them in turn, receives an array of with the list of tokens.

{<custom token 1>: [<token 1>: “token 1”, <token 2>: “token 2”]}
No
authenticatedSession.emailString, Specifies the email address to associate with the widget. If an address is not specified, exports are sent to the email address associated with the user ID.No

Code Samples

The following samples demonstrate how this widget can be used in an HTML page.

ImplementationDescriptionFront-end CodeBack-end Code
Basic API KeyThis sample uses a basic API key to embed an Analytic Suite widget. It does not encrypt the API key and is not suitable for production environments.codepenn/a